<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<ul>
  <li>li1</li>
  <li>li2</li>
  <li>li3</li>
  <li>li4</li>
  <li>li5</li>
</ul>
<script>
  var ul = document.querySelector('ul');

  ul.addEventListener('click', function (e) {
    e.target.style.backgroundColor = "black";
  })
</script>
</body>
</html>